<div class="border_3 pt20 pb20 centered back_bgf">
    <?php
    $form = $this->beginWidget('CActiveForm', array(
    'action' => Yii::app()->createUrl($this->route),
    'method' => 'POST',
    'id' => 'searchForm',
    'htmlOptions'=>array('target'=>'ajax-frame')
    ));
    ?>
    <div id="main_box"  style="height:400px;overflow-y:auto;overflow-x:hidden; margin-top:10px;">
        <table class="fontc_666 height32">
            <tbody>
                <tr height="55">
                    <td valign="top" width="125" align="right" class="pr5"><span class="pr5 fontc_orange_red">*</span>学校代码：</td>
                    <td valign="top" width="370" class="formValidator_td">
                        <input type="text" name="info[school_code]"  value="<?php echo $data['school_code']; ?>" class="col3 pt5 pr10 pb5 pl10 height20 border_c border_3 fontc_666" id='school_code'/>
                        <div class="formValidator_tip">
                            <p id="school_codeTip" ></p>
                        </div>
                    </td>
                </tr>
                <tr height="55">
                    <td valign="top" align="right" class="pr5"><span class="pr5 fontc_orange_red">*</span>上报简称：</td>
                    <td valign="top" class="formValidator_td">
                        <input type="text" name="info[school_nick]" value="<?php echo $data['school_nick']; ?>" class="col3 pt5 pr10 pb5 pl10 height20 border_c border_3 fontc_666" id='school_nick'/>
                        <div class="formValidator_tip">
                            <p id="school_nickTip" ></p>
                        </div>
                    </td>
                </tr>
                <tr height="55">
                    <td valign="top" align="right" class="pr5"><span class="pr5 fontc_orange_red">*</span>学校名称：</td>
                    <td valign="top" class="formValidator_td">
                        <input type="text" name="info[school_name]" value="<?php echo $data['school_name']; ?>" class="col3 pt5 pr10 pb5 pl10 height20 border_c border_3 fontc_666" id='school_name'/>
                        <div class="formValidator_tip">
                            <p id="school_nameTip" ></p>
                        </div>
                    </td>
                </tr>
                <tr height="50">
                    <td valign="top" align="right" class="pr5"><span class="pr5 fontc_orange_red">*</span>学段：</td>
                    <td valign="top" class="formValidator_td">
                        <span class="fl standard_select pt5 pr7 pb5 pl3 border_c border_3">
                            <span class="fl select_shelter">
                                <select class="fl fontc_666" name="info[edu_type_ids]" id='edu_type_ids'>
                                    <option value="">请选择</option>
                                    <?php if (!empty($edu_type)): ?>
                                        <?php foreach ($edu_type as $ev): ?>

                                            <option value="<?php echo $ev['edu_id']; ?>" <?php if ($ev['edu_id'] == $data['edu_type_ids']): ?> selected <?php endif; ?> ><?php echo $ev['edu_name']; ?></option>
                                        <?php endforeach; ?>
                                    <?php endif; ?>
                                </select>
                            </span>
                        </span>
                        <div class="formValidator_tip clear">
                            <p id="edu_type_idsTip" ></p>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="pr5">是否生效：</td>
                    <?php if (!empty($data['disabled'])): ?>
                    <td><input type="checkbox" name="info[disabled]" checked value="1" /></td>
                    <?php else: ?>
                    <td><input type="checkbox" name="info[disabled]"  value="1" /></td>
                    <?php endif; ?>
                </tr>
                <tr>
                    <td valign="top" align="right" valign="top" class="pt15 pr5">备注：</td>
                    <td class="pt15">
                        <textarea name="info[description]" class="col3 pt6 pr10 pb6 pl10 border_c border_3 fontc_666"><?php echo (!empty($data['description'])) ? $data['description'] : ''; ?></textarea>
                    </td>
                </tr>
                <tr>
                    <td align="right" width="125" class="pt20 pr5 pb20"></td>
                    <td  class="pt20 pb20" width="320" >
                        <input type="hidden" value="<?php echo $data['school_id']; ?>" name="info[school_id]" id="school_id">
                        <input type="submit" name="submit" value="保存" class="b_a_n border_3 back_bgfb w80 height32 fontc_FFF fonts_12 cursor mr10" />
                        <input type="button" value="取消" onclick="api.close()" class="b_a_n border_3 back_bgb w80 height32 fontc_FFF fonts_12 cursor" />
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <?php
    $this->endWidget();
    ?>
</div>
<iframe src='' style="display:none" name='ajax-frame'></iframe>


<script type="text/javascript">

function getRegionInfo(id) {
	$.ajax({
		type: 'GET',
		url: "<?php echo $this->createUrl('ajax_region'); ?>",
		data: {parent_id: id},
		success: function(msg) {

			$("#region").html(msg);
		}
	})
}
$(function() {
	$.formValidator.initConfig({formID: "searchForm", theme: "126", submitOnce: false,
	onError: function(msg, obj, errorlist) {
		$("#errorlist").empty();
		$.map(errorlist, function(msg) {
			$("#errorlist").append("<li>" + msg + "</li>")
		});
		alert(msg);
	},
	ajaxPrompt: '有数据正在异步验证，请稍等...'
	});

	/*学校代码验证*/
	$("#school_code").formValidator({
		onShowText: "请输入学校代码",
		onShow: "",
		onFocus: "",
		onCorrect: "输入正确",
		leftTrim:true,
		rightTrim:true
	}).regexValidator({
		regExp: "^[a-zA-Z]{1,}([0-9]|[a-zA-Z])+$",
		onError: "学校代码格式不正确"
	});

	/*上报简称验证*/
	$("#school_nick").formValidator({
		onShowText: "请输入上报简称",
		onShow: "",
		onFocus: "",
		onCorrect: "输入正确",
		leftTrim:true,
		rightTrim:true
	}).inputValidator({
		min: 1,
		max: 20,
		onError: "上报简称长度在1-20之间(1到10个汉字)"
	});

	/*学段验证*/
	$("#edu_type_ids").formValidator({
		onShowText: "",
		onShow: "",
		onFocus: "",
		onCorrect: "选择正确"
	}).inputValidator({
		min: 1,
		onError: "请选择学段"
	});

	/*学校名称验证*/
	$("#school_name").formValidator({
		onShowText: "请输入学校名称",
		onShow: "",
		onFocus: "",
		onCorrect: "输入正确",
		leftTrim:true,
		rightTrim:true
	}).inputValidator({
		min: 1,
		max: 20,
		onError: "学校名称长度在1-20之间(1到10个汉字)"
	});

})

</script>

<?php exit; ?>